/*Load data file first*/

/*TABLE 1 RESULTS*/

/*Replication: Table 1, Column 1*/
/*Table 1, Column 2 of Oneal and Russett 1999 with hegdefb and disp_spl and IGOSame*/*/
#del ;
logit disp_l1 
IGOSame
smldmat smldep 
lcaprat2 allies hegdefb
contig logdstab majpower
disp_spl*,
cluster(dyadid) nolog;

/*Our base model: Table 1, Column 2*/
#del ;
logit disp_l1
IGOSame ClusSame CentDif ClusSizeMax 
smldmat smldep
lcaprat2 allies hegdefb
contig logdstab majpower 
disp_spl*,
cluster(dyadid) nolog;

/*other specifications in order to check robustness*/

/*MinVarModel: Table 1, Column 3*/
#del ;
logit disp_l1 
IGOSame ClusSame CentDif ClusSizeMax
contig logdstab majpower
disp_spl*,
cluster(dyadid) nolog;

/*PR Dyads: Table 1, Column 4*/
#del ;
logit disp_l1 
IGOSame ClusSame CentDif ClusSizeMax
smldmat smldep 
lcaprat2 allies hegdefb 
contig logdstab majpower 
disp_spl*
if majpower==1 | contig==1,
cluster(dyadid) nolog;

/*Dispute Onset: Table 1, Column 5*/
#del ;
logit dispon_l1
IGOSame ClusSame CentDif ClusSizeMax
smldmat smldep 
lcaprat2 allies hegdefb 
contig logdstab majpower
dispon_spl*,
cluster(dyadid) nolog;

/*GEE: Table 1, Column 6*/
#del ;
set matsize 800;
xtgee disp_l1 
IGOSame ClusSame CentDif ClusSizeMax 
smldmat smldep 
lcaprat2 allies hegdefb
contig logdstab majpower, 
family(binomial) link(logit) corr(ar1) force robust nolog;

/*TABLE 2 PROBABILITIES*/
/*Our base model:*/
#del ;
logit disp_l1 
IGOSame ClusSame CentDif ClusSizeMax
smldmat smldep
lcaprat2 allies hegdefb
contig logdstab majpower 
disp_spl*,
cluster(dyadid) nolog;

#del ;
/*Baseline*/
prvalue,  rest(mean) brief;
/*cluster*/
prvalue, x(ClusSame=min) rest(mean) brief;
prvalue, x(ClusSame=max) rest(mean) brief;
/*Prestige*/
prvalue, x(CentDif=min) rest(mean);
prvalue, x(CentDif=max) rest(mean);
/*Size*/
prvalue, x(ClusSizeMax=min) rest(mean);
prvalue, x(ClusSizeMax=max) rest(mean);
/*Social Allies/Rivals*/
prvalue, x(ClusSame=min CentDif=min ClusSizeMax=max) rest(mean) brief;
prvalue, x(ClusSame=max CentDif=max ClusSizeMax=min) rest(mean) brief;
/*Dem*/
prvalue, x(smldmat=min) rest(mean) brief;
prvalue, x(smldmat=max) rest(mean) brief;
/*Dep*/
prvalue, x(smldep=min) rest(mean);
prvalue, x(smldep=max) rest(mean);
